import React, { Component } from 'react'
// import Main from "./fulldemo/Main"

export default class TabD extends Component {
  state = {
    temp:{
      id:1,
      type:"button",
      props:{
        name:""
      }
    },
    array:[]
  }
  componentDidMount() {
    this.createElementByProps()
  }
  createElementByProps = ()=>{
    //以前原生JS采用document创建节点
    // const node = document.createElement()
    //产生React虚拟节点
    const {array} = this.state
    const node = React.createElement("a",{href:"http://www.woniuxy.com"},"蜗牛一下")
    array.push(node)
    this.setState({
      array
    })

    //<p key=1>1</p>
    //React.createElement("p",{key:1},value)

  }
  render() {
    return (
      <div>
        {/* <Main></Main> */}
        {this.state.array}
        <p key={this.state.temp.id}>{this.state.temp.id}</p>
      </div>
    )
  }
}
